using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Specialized;
using System.Xml;
using System.IO;

namespace IPickImporterUI
{
	public abstract class Customers
	{
		private long _CustomerId;
		private string _FirstName;
		private string _LastName;
		private string _Email;
		private string _PWD;
		private DateTime _DateCreated;
		private DateTime _DateInactive;
		private bool _isNew;

		#region Constructors
		
		public Customers()
		{
			_CustomerId = 0;
			_DateInactive = DateTime.Now;
		}
		
		public Customers(long CustomerId) : this()
		{
			_CustomerId = CustomerId;
		}
	
		public Customers(long CustomerId, string FirstName, string LastName, string Email, string PWD, DateTime DateCreated, DateTime DateInactive) : this()
		{
			_CustomerId = CustomerId;
			_FirstName = FirstName;
			_LastName = LastName;
			_Email = Email;
			_PWD = PWD;
			_DateCreated = DateCreated;
			_DateInactive = DateInactive;
		}

		#endregion
		
		#region Properties
		
		public long CustomerId
		{
			get	{ return _CustomerId; }
			set	{ _CustomerId = value; }
		}
		
		public string FirstName
		{
			get	{ return _FirstName; }
			set	{ _FirstName = value; }
		}
		
		public string LastName
		{
			get	{ return _LastName; }
			set	{ _LastName = value; }
		}
		
		public string Email
		{
			get	{ return _Email; }
			set	{ _Email = value; }
		}
		
		public string PWD
		{
			get	{ return _PWD; }
			set	{ _PWD = value; }
		}
		
		public DateTime DateCreated
		{
			get	{ return _DateCreated; }
			set	{ _DateCreated = value; }
		}
		
		public DateTime DateInactive
		{
			get	{ return _DateInactive; }
			set	{ _DateInactive = value; }
		}
		
		public bool IsNew
		{
			get 
			{ 
				_isNew = (_CustomerId == 0);
				return _isNew; 
			}
			set { _isNew = value; }
		}
		
		#endregion		

	
		/// <summary>
		/// Utility function that returns a DBNull.Value if requested. The comparison is done inline
		/// in the Insert() and Update() functions.
		/// </summary>
		private object SetNullValue(bool isNullValue, object value)
		{
			if (isNullValue)
				return DBNull.Value;
			else
				return value;
		}
	}
}
